package es.ceura.wilder.datastructures.response;

import es.ceura.wilder.datastructures.HeaderType;
import es.ceura.wilder.datastructures.Header;
import java.util.HashMap;

/**
 *
 * @author Jorge Madrid
 */
public class HTTPResponse {

    private ResponseStatusLine statusLine;
    private HashMap<HeaderType, Header> headerMap; //TO DO Replace with enumMap?
    private byte[] message;

    public HTTPResponse(ResponseStatusLine statusLine, HashMap<HeaderType, Header> headerMap,
            byte[] message) {
        this.statusLine = statusLine;
        this.headerMap = headerMap;
        this.message = message;
    }

    public HashMap<HeaderType, Header> getHeaderMap() {
        return headerMap;
    }

    public byte[] getMessage() {
        return message;
    }

    public ResponseStatusLine getStatusLine() {
        return statusLine;
    }

    public void setHttpCode(HTTPCode code) {
        statusLine.setCode(code);
    }

    @Override
    public String toString() {
        return "HTTPResponse{" + "statusLine=" + statusLine + ", headerMap=" + headerMap + ", message=" + message + '}';
    }
}
